package com.automannn.atm_back.codegenerate.pojo;

import org.apache.commons.lang.StringUtils;

/**
 * 属性修饰
 * @author chenkh
 * @time 2020/6/27 13:58
 */
public class FieldAddorn {
    public FieldAddorn() {
    }

    public static String yesOrNoAddorn(String nullable) {
        if (!"YES".equals(nullable) && !"yes".equals(nullable) && !"y".equals(nullable) && !"Y".equals(nullable) && !"f".equals(nullable)) {
            return !"NO".equals(nullable) && !"N".equals(nullable) && !"no".equals(nullable) && !"n".equals(nullable) && !"t".equals(nullable) ? null : "N";
        } else {
            return "Y";
        }
    }

    public static String blankAddorn(String nullable) {
        return StringUtils.isBlank(nullable) ? "" : nullable;
    }

    public static String toStringField(String s) {
        return "'" + s + "'";
    }
}
